package tech.dongliang.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import tech.dongliang.interceptor.PowerInterceptor;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new PowerInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/h-ui/**", "/h-ui.admin/**", "/js/**", "/lib/**", "/login", "/uecallback", "/repassword", "/logout", "/", "/welcome", "/error", "/resources/tree", "/resources/getResourcesTreeData");
    }

}
